<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>联系我们</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" type="text/css" href="../css/index.css">
    <link rel="stylesheet" type="text/css" href="../js/swiper/swiper.min.css">
    <script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=CMwTOF7CsRwECMedvXTpSd42"></script>
<!--     <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript" src="../js/filter.js"></script> -->
    <script type="text/javascript" src="../js/config.js"></script>
    <script type="text/javascript" src="../js/index.js"></script>
    <style type="text/css">
      
    </style>
  </head>
  <body style="padding-bottom: 54px;">
    <div id="shopHome">
      <div class="contact-warp">
        <div class="contact-box">
          <h2 class="contact-title"></h2>
          <div class="contact-info">
          </div>
          <div class="map" id="bdmap"></div>
          
        </div>
        <div id="contactPhone"></div>
      </div>
      
      <div class="footer">
        <a href="home.html" class="footer-nav footer-home">首页</a>
        <!-- <a href="cars_list.html" class="footer-nav footer-cars">买车</a> -->
        <a href="contact.html" class="footer-nav footer-contact on">联系</a>
      </div>
    </div>

      
    
  </body>
 <script type="text/javascript" src="../js/swiper/swiper.min.js"></script>
  <script type="text/javascript">
    document.documentElement.style.fontSize=document.documentElement.clientWidth/37.5+'px';
    // var map = new BMap.Map("bdmap"); 
    // var point = new BMap.Point(108.797187,34.258079); 
    // map.centerAndZoom(point, 17);  
    // var marker = new BMap.Marker(point);        // 创建标注    
    // map.addOverlay(marker); 

//     var shopHome = new Vue({
//       el:'#shopHome',
//       data: {
//         res:{}
//       },
//       methods: {
//          
//       },
//     });
    var params='?marketId='+marketId+'&shopId='+shopId+'&imgUrl='+imgUrl+'&customerShopId='+customerShopId;
    $('.footer-home').attr('href','home.html'+params);
    // $('.footer-cars').attr('href','cars_list.html'+params);
    $('.footer-contact').attr('href','contact.html'+params);
    if (shopId == '') {
      $.ajax({
        type: "get",      //data 传送数据类型。post 传递
        dataType: 'json',  // 返回数据的数据类型json
        url: defaultUrl+"/controller/getMarketList",  // yii 控制器/方法
        cache: false, 
        data: {'marketId':marketId},  //传送的数据     
        error:function(){
          alert("数据传输错误");
        },success: function (data) {
          console.log(data);
          if (data.code != 1) {
            return false
          }
          var res = data.result[0];
          $('.contact-title').html(res.marketName);
          var contactInfoHtml = '<p>电话：'+res.marketMobile+'</p>'
              +'<p>地址：'+res.marketAddress+'</p>';
          $('.contact-info').html(contactInfoHtml);
          $('#contactPhone').html('<a class="contact-btn" href="tel:'+res.marketMobile+'">'+res.marketMobile+'</a>')
          var map = new BMap.Map("bdmap"); 
          var point = new BMap.Point(res.marketLat,res.marketLng); 
          map.centerAndZoom(point, 15);  
          var marker = new BMap.Marker(point);        // 创建标注    
          map.addOverlay(marker); 
          // pricetag.res = data.result;
        } 
      });
    }else{
      $.ajax({
        type: "get",      //data 传送数据类型。post 传递
        dataType: 'json',  // 返回数据的数据类型json
        url: defaultUrl+"/controller/getShopList",  // yii 控制器/方法
        cache: false, 
        data: {'shopId': shopId},  //传送的数据     
        error:function(){
          alert("数据传输错误");
        },success: function (data) {
          console.log(data);
          if (data.code != 1) {
            return false
          }
          var res = data.result[0];
          $('.contact-title').html(res.shopName);
          var contactInfoHtml = '<p>电话：'+res.shopMobile+'</p>'
              +'<p>地址：'+res.market.marketAddress+'</p>';
          $('.contact-info').html(contactInfoHtml);
          $('#contactPhone').html('<a class="contact-btn" href="tel:'+res.shopMobile+'">'+res.shopMobile+'</a>')
          var map = new BMap.Map("bdmap"); 
          var point = new BMap.Point(res.market.marketLat,res.market.marketLng); 
          map.centerAndZoom(point, 15);  
          var marker = new BMap.Marker(point);        // 创建标注    
          map.addOverlay(marker); 
          // pricetag.res = data.result;
        } 
      });
    }
    

    // $.ajax({
    //   type: "get",      //data 传送数据类型。post 传递
    //   dataType: 'json',  // 返回数据的数据类型json
    //   url: defaultUrl+"/controller/getCarConfById",  // yii 控制器/方法
    //   cache: false,      
    //   data: {'carId': carId},  //传送的数据
    //   error:function(){
    //      alert("数据传输错误");
    //   },success: function (data) {
    //     console.log(data);
    //      if (data.code != 1) {
    //       return false
    //      }
    //      for (var i = 0; i < data.result.length; i++) {
    //         for (var j = 0; j < data.result[i].childCarConf.length; j++) {
    //           if (data.result[i].childCarConf[j].selectedState) {
    //             pricetag.carConfList.push(data.result[i].childCarConf[j].confName);
    //           }
    //           if (pricetag.carConfList.length>0) {
    //             pricetag.carConfListBoolean = true;
    //           }else{
    //             pricetag.carConfListBoolean = false;
    //           }
    //         }
    //      }
    //   }
    // });







  </script>
</html>


































